package com.jumlabs.data.entities.drive;

import java.io.Serializable;
import javax.persistence.*;
import org.codehaus.jackson.annotate.JsonIgnore;
import java.util.Date;
import java.util.List;


/**
 * The persistent class for the file database table.
 * 
 */
@Entity


public class File implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	private String id;

	@Temporal(TemporalType.TIMESTAMP)
	private Date created;

	private String description;

	@Column(name="dowload_url")
	private String dowloadUrl;

	@Column(name="file_extension")
	private String fileExtension;

	@Column(name="file_size")
	private Integer fileSize;

	@Column(name="is_directory")
	private Byte isDirectory;

	@Temporal(TemporalType.TIMESTAMP)
	private Date modified;

	private String name;

	private String path;

	private String title;

	private String type;

	@Temporal(TemporalType.TIMESTAMP)
	private Date viewed;

	//bi-directional many-to-one association to Drive
	@ManyToOne	
	private Drive drive;

	//bi-directional many-to-one association to File
	@ManyToOne
	@JoinColumn(name="parent")
	@JsonIgnore
	private File parent;

	//bi-directional many-to-one association to File
	@OneToMany(mappedBy="parent")
	private List<File> files;

	public File() {
	}

	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public Date getCreated() {
		return this.created;
	}

	public void setCreated(Date created) {
		this.created = created;
	}

	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getDowloadUrl() {
		return this.dowloadUrl;
	}

	public void setDowloadUrl(String dowloadUrl) {
		this.dowloadUrl = dowloadUrl;
	}

	public String getFileExtension() {
		return this.fileExtension;
	}

	public void setFileExtension(String fileExtension) {
		this.fileExtension = fileExtension;
	}

	public Integer getFileSize() {
		return this.fileSize;
	}

	public void setFileSize(Integer fileSize) {
		this.fileSize = fileSize;
	}

	public Byte getIsDirectory() {
		return this.isDirectory;
	}

	public void setIsDirectory(byte isDirectory) {
		this.isDirectory = isDirectory;
	}
	
	
	public Date getModified() {
		return this.modified;
	}

	public void setModified(Date modified) {
		this.modified = modified;
	}

	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getPath() {
		return this.path;
	}

	public void setPath(String path) {
		this.path = path;
	}

	public String getTitle() {
		return this.title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getType() {
		return this.type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public Date getViewed() {
		return this.viewed;
	}

	public void setViewed(Date viewed) {
		this.viewed = viewed;
	}
	
	@JsonIgnore
	public Drive getDrive() {
		return this.drive;
	}

	public void setDrive(Drive drive) {
		this.drive = drive;
	}

	public File getParent() {
		return this.parent;
	}

	public void setParent(File file) {
		this.parent = file;
	}
	
	@JsonIgnore
	public List<File> getFiles() {
		return this.files;
	}

	public void setFiles(List<File> files) {
		this.files = files;
	}

}